<template>
  <div class="DrugCollection">
    <div class="pubBig drugBig">
      <div class="h0">
        <p class="lt">{{msg.title}}</p>
      </div>
      <div class="m0">
        <div class="form-group">
          <fieldset>
            <legend>查询条件</legend>
            <div>
              <p>
                <label>日期：</label>
                <vue-datepicker-local
                  v-model="info.beforeTime"
                  style="width:125px;height:32px"
                />-
                <vue-datepicker-local
                  v-model="info.EndTime"
                  style="width:125px;height:32px"
                />
              </p>
              <p>
                <label>状态：</label>
                <select
                  class="form-control"
                  v-model="info.status"
                  placeholder="请选择"
                >
                  <option
                    v-for="(item,index) in select_status"
                    :label="item.name"
                    :value="item.code"
                    :key="index"
                  ></option>
                </select>
              </p>
              <p>
                <label>单号：</label>
                <input
                  type="text"
                  class="form-control"
                  v-model="info.Daninfo"
                />
              </p>
              <p
                class="danWei"
                style="width:264px"
              >
                <label>调拨科室 ：</label>
                <el-autocomplete
                  style="width:152px"
                  v-model="info.KeShinfo"
                  :fetch-suggestions="querySearch"
                  placeholder="请输入调拨科室"
                  @select="handleSelect"
                ></el-autocomplete>
              </p>
              <p>
                <button
                  class="btn btn-default"
                  @click="Inquery()"
                >查询</button>
                <button class="btn btn-default">退出</button>
              </p>
            </div>
          </fieldset>
        </div>
      </div>
      <div class="dUpMain">
        <div class="oneBox clearfix">
          <p class="p1">药品退药</p>
          <div class="form-group clearfix">
            <p>
              <label>单号：</label>
              <input
                type="text"
                class="form-control"
                v-model="infoYAoP.serial_no"
                readonly
              />
            </p>
            <p
              class="danWei"
              style="width:255px"
            >
              <label>调拨科室 ：</label>
              <el-autocomplete
                style="width:152px"
                v-model="infoYAoP.export_storage"
                :fetch-suggestions="querySearch"
                placeholder="请输入调拨科室"
                @select="handKeSelect"
              ></el-autocomplete>
            </p>
            <p>
              <label>接收科室：</label>
              <el-autocomplete
                style="width:152px"
                v-model="infoYAoP.import_storage"
                :fetch-suggestions="querySearch"
                placeholder="请输入接收科室"
                @select="handjieKeSelect"
              ></el-autocomplete>
            </p>
            <p>
              <label>日期：</label>
              <vue-datepicker-local
                v-model="infoYAoP.create_date"
                style="width:125px;height:32px"
              />
            </p>
            <p>
              <label>备注：</label>
              <input
                type="text"
                class="form-control"
                v-model="infoYAoP.memo"
              />
            </p>
          </div>
        </div>
        <div class="twoBox">
          <div class="Tb">
            <table class="table">
              <thead>
                <tr>
                  <th>单号</th>
                  <th>调出科室</th>
                  <th>接收科室</th>
                  <th>状态</th>
                  <th>日期</th>
                  <th>审核人</th>
                  <th>审核日期</th>
                </tr>
              </thead>
              <tbody>
                <tr
                  v-for="(item,index) in Pharmaceuticalist"
                  :key="index"
                  :class="{selGreen:Phatabindex == index}"
                  @click="getable(item,index)"
                >
                  <td>{{item.serial_no}}</td>
                  <td>{{item.export_storage_name}}</td>
                  <td>{{item. import_storage_name}}</td>
                  <td>{{item.allocation_status_name}}</td>
                  <td>{{item.create_date}}</td>
                  <td>{{item.acct_opeartor}}</td>
                  <td>{{item.acct_datetime}}</td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="btns">
            <button
              class="btn btn-info"
              @click="Audit"
            >审核</button>
            <button
              class="btn btn-default"
              onclick="$('.printBg').show()"
            >打印</button>
            <button
              class="btn btn-default"
              @click="Remove"
            >删除</button>
            <!-- <button class="btn btn-default" @click="AddInZhu">新开</button>
            <button class="btn btn-default" @click="SuccessfulZB">保存</button>
            <button class="btn btn-info" @click="Audit">审核</button>
            <button class="btn btn-info" @click="Submit">提交</button>
            <button class="btn btn-default" @click="Remove">删除</button>
            <button class="btn btn-default" onclick="$('.printBg').show()">打印</button>-->
            <label>
              <input type="checkbox" />显示
            </label>
          </div>
        </div>
      </div>
      <div class="dDownMain">
        <p class="p1">药品入库明细</p>
        <div class="twoBox">
          <table class="table table-bordered">
            <thead>
              <tr>
                <th>序号</th>
                <th>编号</th>
                <th>药品名称</th>
                <th>规格</th>
                <th>单位</th>
                <th>批次</th>
                <th>数量</th>
                <th>当前库存</th>
                <th>零售价</th>
                <th>金额</th>
                <th>药品期效</th>
                <th>产地</th>
                <th>生产批号</th>
                <th>进价</th>
                <th>进价金额</th>
              </tr>
            </thead>
            <tbody>
              <tr
                v-for="(item1,index1) in mingxitable"
                :key="index1"
                :class="{selGreen:Mxtabindex == index1}"
                @click="MXtabtrinfo(item1,index1)"
              >
                <td>{{item1.drug_no}}</td>
                <td>{{item1.drug_code}}</td>
                <td>{{item1.drug_name}}</td>
                <td>{{item1.drug_spec}}</td>
                <td>{{item1.unit}}</td>
                <td>{{item1.quantity}}</td>
                <td>{{item1.inventory}}</td>
                <td>{{item1.retail_price}}</td>
                <td>{{item1.pack_purchase_price}}</td>
                <td>{{item1.totalcont}}</td>
                <td>{{item1.expire_date}}</td>
                <td>{{item1.firm_id}}</td>
                <td>{{item1.batch_no}}</td>
                <td>{{item1.purchase_price}}</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <div class="dFootMain">
        <div class="lt">
          <p class="danWei">
            <span>编号/拼音码</span>
            <el-autocomplete
              style="width: 114px !important;padding: 0px; height: 26px !important;"
              v-model="mingxiobj.drug_code"
              :fetch-suggestions="handleCreditChange"
              v-popover:popover
              @keyup.native="show($event)"
              placeholder
            ></el-autocomplete>
          </p>
          <p>
            <span>药品名称</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.drug_name"
            />
          </p>
          <p>
            <span>规格</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.drug_spec"
            />
          </p>
          <p>
            <b>笔数</b>
            {{BiShu}}
            <b>总金额</b>
            {{BiShuconsE}}
          </p>
          <p>
            <span>进价</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.purchase_price"
            />
          </p>
          <p>
            <span>生产批号</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.batch_no"
            />
          </p>
          <p>
            <span>数量</span>
            <input
              type="text"
              class="form-control"
              v-model="mingxiobj.quantity"
            />
          </p>
          <p>
            <span>药品期效</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.expire_date"
            />
          </p>
          <p>
            <span>零售价</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.retail_price"
            />
          </p>
          <p>
            <span>进价金额</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.purchase_price"
            />
          </p>
          <p>
            <span>类别</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.drug_flag_name"
            />
          </p>
          <p>
            <span>剂型</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.drug_form_name"
            />
          </p>
          <p>
            <span>批准文号</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.batch_no"
            />
          </p>
          <p>
            <span>产地</span>
            <input
              type="text"
              class="form-control"
              readonly
              v-model="mingxiobj.firm_id"
            />
          </p>
        </div>
        <div class="rm">
          <p>
            <button
              class="btn btn-default"
              @click="AnewOpened"
            >新开</button>
            <button
              class="btn btn-default"
              @click="Successful"
            >保存</button>
            <button
              class="btn btn-default"
              @click="DelteOpened"
            >删除</button>
          </p>
        </div>
      </div>
    </div>
    <!--选择药品弹框-->
    <div>
      <el-popover
        placement="bottom-start"
        width="800"
        v-model="isShow"
        ref="popover"
      >
        <div>
          <el-table
            ref="singleTable"
            :data="ykKCList"
            height="300"
            :row-style="rowClass"
            @row-click="tClick"
            style="width: 100%"
          >
            <el-table-column
              property="drug_code"
              label="编号"
              width="50"
            ></el-table-column>
            <el-table-column
              property="drug_name"
              label="名称"
              width="220"
            ></el-table-column>
            <el-table-column
              property="drug_spec"
              label="规格"
              width="120"
            ></el-table-column>
            <el-table-column
              property="batch_no"
              label="生产批号"
              width="80"
            ></el-table-column>
            <el-table-column
              property="expire_date"
              label="有效期"
              width="180"
              show-overflow-tooltip
            ></el-table-column>
            <el-table-column
              property="firm_id"
              label="生产厂家"
              width="80"
            ></el-table-column>
            <el-table-column
              property="storage"
              label="库存"
              width="50"
            ></el-table-column>
            <el-table-column
              property="unit_name"
              label="单位"
              width="50"
            ></el-table-column>
            <el-table-column
              property="purchase_price"
              label="进价"
              width="80"
            ></el-table-column>
            <el-table-column
              property="retail_price"
              label="售价"
              width="80"
            ></el-table-column>
            <el-table-column
              property="drug_form_name"
              label="剂型"
              width="80"
            ></el-table-column>
          </el-table>
        </div>
      </el-popover>
    </div>
  </div>
</template>
<script>
import VueDatepickerLocal from "vue-datepicker-local";
export default {
  name: "DrugCollection",
  components: {
    VueDatepickerLocal
  },
  data () {
    return {
      msg: "DrugDepotSystem 下的 DrugCollection",
      restaurants: [], //科室数组
      //    查询条件
      select_status: [], //状态数组
      info: {
        beforeTime: "", //开始时间
        EndTime: "", //结束时间
        status: -1, //状态
        Daninfo: "", //单号
        KeShinfo: "", //调拨科室
        KeShinfocode: "" //调拨科室 code
      },
      //药品退药
      Pharmaceuticalist: [], //主表table
      Phatabindex: -1, //table tr 选中样式 index
      infoYAoP: {
        serial_no: "", //单号
        export_storage: "", //调拨科室
        import_storage: "", //接收科室
        person: "", //经手人
        create_date: "", //日期
        memo: "" //备注
      },
      //   Yku_select_status: [], //药库列表
      //药品入库明细
      mingxitable: [], //明细表table
      Mxtabindex: -1, //选中明细表table index 改变
      ykKCList: [], //弹框table list
      isShow: false, //弹框是否显示
      index: -1, //弹框index
      currentRow: null,
      selectData: null,
      mingxiobj: {
        drug_code: "", //编号/拼音码
        drug_name: "", //药品名称
        drug_spec: "", //规格
        purchase_price: 0, //进价   和   进价金额
        batch_no: "", // 生产批号   和  批准文号
        quantity: 0, //数量
        expire_date: "", //药品期效
        retail_price: 0, //零售价
        drug_flag_name: "", //类别
        drug_form_name: "", //剂型
        firm_id: "" //产地
      },
      BiShuconsE: 0, //
      BiShu: 0
    };
  },
  methods: {
    queryG (KeyCode) {
      var data = {
        code: "get_sys_dict2",
        input: {
          code: KeyCode
        }
      };
      this.$post("CloudHIS/getRedisDataByCode", data)
        .then(res => {
          console.log(res);
          res.data.forEach(v => {
            if (v.keycode == "review_status") {
              console.log("获取状态列表");
              console.log(v.dtl);
              let obj = {
                code: "-1",
                name: "请选择",
                pym: null
              };
              v.dtl.unshift(obj);
              this.select_status = v.dtl;
              this.info.status = v.dtl[0].code;
            }
          });
        })
        .catch(err => {
          console.log(err);
        });
    },
    getKedata () {
      var data = {
        code: "get_section"
      };
      this.$post("CloudHIS/getRedisDataByCode", data)
        .then(res => {
          console.log("获取科室列表");
          console.log(res);
          this.restaurants = res.data;
          this.restaurants.forEach(v => {
            v.value = v.name;
          });
        })
        .catch(err => {
          console.log(err);
        });
    },
    // getKudata() {
    //   var data = {
    //     code: "get_storage"
    //   };
    //   this.$post("CloudHIS/getRedisDataByCode", data)
    //     .then(res => {
    //       console.log("获取药库列表");
    //       console.log(res);
    //       this.Yku_select_status = res.data;
    //       this.infoYAoP.import_storage = res.data[0].id;
    //     })
    //     .catch(err => {
    //       console.log(err);
    //     });
    // },
    querySearch (queryString, cb) {
      var restaurants = this.restaurants;
      var results = queryString
        ? restaurants.filter(this.createFilter(queryString))
        : restaurants;
      // 调用 callback 返回建议列表的数据
      cb(results);
    },
    createFilter (queryString) {
      return restaurant => {
        return (
          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ==
          0 ||
          restaurant.pym.toLowerCase().indexOf(queryString.toLowerCase()) == 0
        );
      };
    },
    handleSelect (item) {
      console.log("查询条件调拨科室");
      console.log(item);
      this.info.KeShinfocode = item.id;
    },
    Inquery () {
      var data = {
        model: "7.药房-调拨申请",
        code: "7202",
        input: {
          create_date_start: this.info.beforeTime
            ? this.info.beforeTime
            : "2000-03-21 00:00:00",
          create_date_end: this.info.EndTime
            ? this.info.EndTime
            : this.formatDateTime(new Date()),
          allocation_status: this.info.status ? this.info.status : -1,
          serial_no: this.info.Daninfo ? this.info.Daninfo : "",
          export_storage: this.info.KeShinfocode ? this.info.KeShinfocode : -1
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          if (res.code == 0) {
            this.Pharmaceuticalist = res.data;
            console.log(res);
            this.$message({
              showClose: true,
              message: res.msg,
              type: "success"
            });
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    formatDateTime (date) {
      var y = date.getFullYear();
      var m = date.getMonth() + 1;
      m = m < 10 ? "0" + m : m;
      var d = date.getDate() + 1;
      d = d < 10 ? "0" + d : d;
      var h = date.getHours();
      h = h < 10 ? "0" + h : h;
      var minute = date.getMinutes();
      minute = minute < 10 ? "0" + minute : minute;
      var second = date.getSeconds();
      second = second < 10 ? "0" + second : second;
      return y + "-" + m + "-" + d + " " + h + ":" + minute + ":" + second;
    },
    getable (info, index) {
      //选中主表
      this.Phatabindex = index;
      this.infoYAoP = info;
      console.log(info);
      this.getmingxitable(info);
    },
    handKeSelect (item) {
      console.log("查询条件调拨科室");
      console.log(item);
      this.infoYAoP.export_storage = item.id;
    },
    handjieKeSelect (item) {
      console.log("查询条件接收科室");
      console.log(item);
      this.infoYAoP.import_storage = item.id;
    },
    AddInZhu () {
      this.infoYAoP = {};
    },
    SuccessfulZB () {
      var data = {
        model: "7.药房-调拨申请",
        code: "7201",
        input: {
          hospital_id: this.infoYAoP.hospital_id
            ? this.infoYAoP.hospital_id
            : -1,
          serial_no: this.infoYAoP.serial_no ? this.infoYAoP.serial_no : -1,
          export_storage: this.infoYAoP.export_storage,
          import_storage: this.infoYAoP.import_storage, //接收科室
          create_operator: this.infoYAoP.person ? this.infoYAoP.person : -1,
          create_date: this.infoYAoP.create_date
            ? this.infoYAoP.create_date
            : "2019-11-29 23:00:00",
          import_status: -1,
          memo: this.infoYAoP.memo ? this.infoYAoP.memo : ""
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          console.log(res);
          if (res.code == 0) {
            this.Inquery();
            this.$message({ message: res.msg, type: "success" });
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    Audit () {
      console.log(this.infoYAoP.serial_no);
      var data = {
        model: "7.药房-调拨申请",
        code: "7207",
        input: {
          serial_no: this.infoYAoP.serial_no,
          acct_flag: 2
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          console.log(res);
          if (res.code == 0) {
            this.Inquery();
            this.$message({ message: res.msg, type: "success" });
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    Submit () {
      var data = {
        model: "7.药房-调拨申请",
        code: "7207",
        input: {
          serial_no: this.infoYAoP.serial_no ? this.infoYAoP.serial_no : -1,
          acct_flag: 1
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          console.log(res);
          if (res.code == 0) {
            this.Inquery();
            this.$message({ message: res.msg, type: "success" });
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    Remove () {
      var data = {
        model: "7.药房-调拨申请",
        code: "7203",
        input: {
          serial_no: this.infoYAoP.serial_no ? this.infoYAoP.serial_no : -1
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          console.log(res);
          if (res.code == 0) {
            this.Inquery();
            this.$message({ message: res.msg, type: "success" });
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    setCurrent (row) {
      //this.$refs.singleTable.bodyWrapper.scrollTop =0;
      // this.$refs.singleTable.bodyWrapper.scrollTop = this.$refs.tableList.bodyWrapper.scrollHeight;
      this.$refs.singleTable.setCurrentRow(row);
      console.log("上下选中数据");
      console.log(row);
      this.selectData = row;
    },
    tClick (row) {
      //鼠标选中行赋值
      console.log("点击了我");
      console.log(row);
      this.mingxiobj = row;
      this.mingxiobj.quantity = "";
      this.isShow = false;
    },
    rowClass ({ row, rowIndex }) {
      //选中行样式
      if (this.index === rowIndex) {
        return { color: "#fff", "background-color": "#155a00" };
      }
    },
    //键盘触发事件
    show (ev) {
      this.isShow = true;
      console.log(ev.keyCode);
      //向上 =38
      if (ev.keyCode == 38) {
        //当焦点在第一行的时候 按向上的时候焦点要聚焦到前一列的最后一个
        console.log("按上");
        if (this.index - 1 != -1) {
          this.index = this.index - 1;
          this.setCurrent(this.ykKCList[this.index]);
        }
      }
      //下 = 40
      if (ev.keyCode == 40) {
        //当newIndex 在最后一行的时候 焦点要聚焦到 下一列的第一个
        console.log("按下");
        if (this.index + 1 <= this.ykKCList.length - 1) {
          this.index = this.index + 1;
          this.setCurrent(this.ykKCList[this.index]);
        }
      }
      //左 = 37
      if (ev.keyCode == 37) {
        console.log("按左");
      }
      if (ev.keyCode == 13) {
        console.log("按回车");
        console.log(this.selectData);
        this.mingxiobj = this.selectData;
        this.mingxiobj.quantity = "";
        this.isShow = false;
      }
      //右 = 39
      if (ev.keyCode == 39) {
        console.log("按右");
      }
    },
    MXtabtrinfo (item, index) {
      this.Mxtabindex = index;
      console.log(item);
      this.mingxiobj = item;
    },
    handleCreditChange (queryString, cb) {
      console.log("拼音码：");
      console.log(queryString);
      cb(queryString);
      this.getKCYPList();
    },
    getKCYPList () {
      ////////待交流
      if (this.infoYAoP.export_storage == null) {
        this.$message({
          showClose: true,
          message: "请选择药品药库",
          type: "error"
        });
        return;
      }
      var data = {
        model: "7.药房-药房库存",
        code: "7011",
        input: {
          drug_storage: this.infoYAoP.export_storage
            ? this.infoYAoP.export_storage
            : -1,
          drug_class: -1,
          jm: this.mingxiobj.drug_code
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          if (res.code == 0) {
            console.log("药库库存返回结果");
            console.log(res);
            this.ykKCList = res.data;
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    AnewOpened () {
      this.mingxiobj = {};
    },
    Successful () {
      if (this.mingxiobj.quantity == 0) {
        this.$message({
          showClose: true,
          message: "数量不可为空",
          type: "error"
        });
        return;
      }
      console.log(this.mingxiobj);
      var data = {
        model: "7.药房-调拨申请",
        code: "7204",
        input: {
          hospital_id: this.mingxiobj.hospital_id,
          serial_no: this.infoYAoP.serial_no, // 单号,
          drug_no: this.mingxiobj.drug_no ? this.mingxiobj.drug_no : -1, //序号,
          drug_code: this.mingxiobj.drug_code, //药品代码,
          drug_spec: this.mingxiobj.drug_spec, //药品规格,
          unit: this.mingxiobj.unit, //药品单位,
          batch_no: this.mingxiobj.batch_no, //批号,
          expire_date: this.mingxiobj.expire_date, //有效期,
          firm_id: this.mingxiobj.firm_id, //厂家标识,
          purchase_price: this.mingxiobj.purchase_price, //进价,
          retail_price: this.mingxiobj.retail_price, //零售价,
          pack_purchase_price:
            this.mingxiobj.purchase_price / this.mingxiobj.quantity, //包装进价,
          pack_retail_price:
            this.mingxiobj.retail_price / this.mingxiobj.quantity, //包装零售价,
          package_spec: this.mingxiobj.min_spec, //包装规格,
          quantity: this.mingxiobj.quantity, // 数量,
          package_unit: this.mingxiobj.min_unit, //包装单位,
          sub_package: this.mingxiobj.quantity, //包装数量,
          package_quantity: this.mingxiobj.quantity / this.mingxiobj.quantity, //封包数量,
          trade_price: this.mingxiobj.purchase_price, //批发价,
          inventory: this.mingxiobj.inventory, //退药后库存数,
          memo: "" //备注
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          console.log(res);
          if (res.code == 0) {
            this.getmingxitable(this.mingxiobj);
            this.$message({ message: res.msg, type: "success" });
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    DelteOpened () {
      console.log(this.mingxiobj);
      var data = {
        model: "7.药房-调拨申请",
        code: "7206",
        input: {
          serial_no: this.infoYAoP.serial_no, // 单号,
          drug_no: this.mingxiobj.drug_no //序号,
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          console.log(res);
          if (res.code == 0) {
            this.getmingxitable(this.mingxiobj);
            this.$message({ message: res.msg, type: "success" });
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    getmingxitable (inmful) {
      this.BiShuconsE = 0;
      this.BiShu = 0;
      this.mingxitable = [];
      var data = {
        model: "7.药房-调拨申请",
        code: "7205",
        input: {
          serial_no: inmful.serial_no
        }
      };
      this.$post("CloudHIS/Business_Handle", data)
        .then(res => {
          if (res.code == 0) {
            this.Mxtabindex = -1;
            this.mingxitable = res.data;
            res.data.forEach(v => {
              v.totalcont = v.retail_price * v.quantity;
              this.BiShuconsE += v.totalcont;
            });
            this.BiShu = this.mingxitable.length;
          } else {
            this.$message({ showClose: true, message: res.msg, type: "error" });
          }
          console.log(res);
        })
        .catch(err => {
          console.log(err);
        });
    }
  },
  created () {
    this.msg = this.$route.query;
    this.queryG(["review_status"]);
    this.getKedata();
    // this.getKudata();
  }
};
</script>
<style lang="scss">
.DrugCollection {
  .banLi_mark {
    float: right !important;
    margin-right: 0 !important;
  }
  .banLi_mark label {
    background: none !important;
    border: none !important;
    width: 110px;
    cursor: pointer;
  }
  .banLi_mark label input {
    position: relative;
    margin-right: 5px;
    top: 2px;
  }
  .dFootMain .lt b {
    display: inline-block;
    width: 90px;
    text-align: right;
  }
  .el-input__inner {
    height: 32px !important;
    padding: 0 0 0 15px !important;
  }
  .datepicker > input {
    height: 32px;
  }
  .dFootMain {
    .lt {
      .danWei {
        input {
          width: 114px;
        }
        .el-input__inner {
          height: 26px !important;
        }
      }
    }
  }
  .form-group {
    .lt {
      .danWei {
        input {
          width: 114px;
        }
        .el-input__inner {
          height: 26px !important;
        }
      }
    }
  }
  .drugBig .form-control {
    width: 114px;
  }
}
</style>